mui.init();
mui.plusReady(function(){
	document.getElementById('searchInput').addEventListener('keyup',searchName);
	function searchName(e){
		console.log(e.keyCode);
		if(e.keyCode == 13) {
        		//$("#searchInput").blur();
	        mui.openWindow({
	            id: 'newfriend.html',
	            url: 'newfriend.html',
	            extras: {
	                keyword: document.getElementById('searchInput').value
	            }
	        })
	    }
	}
	document.getElementById('searchBtn').addEventListener('tap', function(){
		 mui.openWindow({
	            id: 'newfriend.html',
	            url: 'newfriend.html',
	            extras: {
	                keyword: document.getElementById('searchInput').value
	            }
	        })
	});
	
	mui("#tophrefs").on("tap", "a", function() {
		//plus.webview.getWebviewById('pages/contacts/index.html').hide();
		//plus.webview.currentWebview().hide();
		var targets = this.getAttribute("href");

		mui.openWindow({
			url: targets,
			id: targets
		});

	});
});